from PIL import Image, ImageDraw

# 打开图片
image = Image.open("../image/1236.png")
draw = ImageDraw.Draw(image)

# 定义坐标点
coordinates = [
    (309, 674), (440, 258), (1135, 551), (434, 529), (1127, 540), (433, 555), (1123, 534), (770, 526), (1130, 547),
    (769, 258), (1129, 534), (712, 387), (1129, 536), (1235, 165), (856, 621), (854, 620), (1139, 630), (1260, 659),
    (1118, 557), (1164, 713), (677, 602),
    (246, 628), (238, 205), (216, 187), (241, 483), (228, 178), (240, 210), (229, 189), (572, 478), (217, 193),
    (570, 206), (237, 198), (536, 336), (231, 200), (1178, 101), (818, 579), (818, 579), (957, 564), (1206, 608),
    (982, 494), (140, 129), (577, 502)
]

# 在每个坐标点上画圆
for x, y in coordinates:
    draw.ellipse((x - 5, y - 5, x + 5, y + 5), fill="red")

# 保存结果
image.save("image/1236.png")
def zhandou():
    print("战斗")
def tuisi():
    print("退四次")
xunzhang = 30
yijing = 3
while xunzhang > 0:

    if yijing>7:
        tuisi()
    zhandou()
    yijing += 1
    print(yijing)
    if yijing == 9:
        yijing = 0
        print('打满9次重置为0')
    xunzhang -= 1
    print(xunzhang)



